package com.skyolder.crutch.word.raw;

import com.skyolder.crutch.error.GrammarError;

public class StringHelper {
	public static String getString(BufferCharQueue bufferCharQueue) throws GrammarError {
		StringBuilder stringBuilder = new StringBuilder();
		while (true) {
			char cc = bufferCharQueue.peekChar();
			if (cc >= '0' && cc <= '9') {
				stringBuilder.append(cc);
				continue;
			}
			if (cc >= 'a' && cc < 'z') {
				stringBuilder.append(cc);
				continue;
			}
			if (cc >= 'A' && cc < 'Z') {
				stringBuilder.append(cc);
				continue;
			}
			break;
		}
		return stringBuilder.toString();
	}
}
